package cn.jbolt.core.model;

import cn.jbolt.core.annotation.JBoltAutoCache;
import cn.jbolt.core.annotation.TableBind;
import cn.jbolt.core.base.JBoltIDGenMode;
import cn.jbolt.core.model.base.BaseUser;

import java.util.List;

@SuppressWarnings("serial")
@JBoltAutoCache(keyCache = true, column = "username")
@TableBind(dataSource = "main", table = "jb_user", primaryKey = "id", idGenMode = JBoltIDGenMode.SNOWFLAKE)
public class User extends BaseUser<User> {
    public static final int SEX_NONE = 0; // 未知
    public static final int SEX_MALE = 1; // 男
    public static final int SEX_FEMALE = 2; // 女

    private String deptSnAndName;
    private List<Role> userRoles;
    private List<Post> userPosts;


    public List<Role> getUserRoles(){
        return userRoles;
    }

    public List<Post> getUserPosts(){
        return userPosts;
    }

    public String getDeptSnAndName() {
        return deptSnAndName;
    }

    public void setDeptSnAndName(String deptSnAndName) {
        this.deptSnAndName = deptSnAndName;
    }

    public void setUserRoles(List<Role> userRoles) {
        this.userRoles = userRoles;
    }

    public void setUserPosts(List<Post> userPosts) {
        this.userPosts = userPosts;
    }
}
